using System;
using UnityEngine;

namespace LS.Entity
{
    public class EntityParams : DataParamsBase
    {
        private int m_EntityTypeId = 0;
        private bool m_CreateBySaving = false;
        private Guid? m_SpecialGuid = Guid.Empty;
        private Vector3 m_Position = Vector3.zero;
        private Quaternion m_Rotation = Quaternion.identity;
        private Vector3 m_Scale = Vector3.one;
        public EntityParams() : base()
        {

        }

        /// <summary>
        /// 实体类型编号。
        /// </summary>
        public int EntityTypeId
        {
            set
            {
                m_EntityTypeId = value;
            }

            get
            {
                return m_EntityTypeId;
            }
        }

        public bool CreateBySaving
        {
            get => m_CreateBySaving;
            set => m_CreateBySaving = value;
        }
        /// <summary>
        /// 实体位置。
        /// </summary>
        public Vector3 Position
        {
            get
            {
                return m_Position;
            }

            set
            {
                m_Position = value;
            }
        }

        /// <summary>
        /// 实体朝向。
        /// </summary>
        public Quaternion Rotation
        {
            get
            {
                return m_Rotation;
            }

            set
            {
                m_Rotation = value;
            }
        }

        /// <summary>
        /// 实体朝向。
        /// </summary>
        public Vector3 Scale
        {
            get
            {
                return m_Scale;
            }

            set
            {
                m_Scale = value;
            }
        }

        public Guid? SpecialGuid
        {
            get
            {
                return m_SpecialGuid;
            }

            set
            {
                m_SpecialGuid = value;
            }
        }
        
        public override void Clear()
        {
            m_EntityTypeId = 0;
            m_CreateBySaving = false;
            m_Position = Vector3.zero;
            m_Rotation = Quaternion.identity;
            m_Scale = Vector3.one;
            m_SpecialGuid = null;
            base.Clear();
        }
    }
}
